package org.tea.inventory.enums;

import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * @author hanzy
 * @description 客户表彰类型
 * @date 2023年04月06日 14:03
 */
public enum CustomerTrewardTypeEnum {
    Personal("0", "个人"),
    Group("1", "集体"),
    ;

    @Getter
    @Setter
    private String code;
    @Getter
    @Setter
    private String content;

    CustomerTrewardTypeEnum(String code, String content) {
        this.code = code;
        this.content = content;
    }

    public static String getContentByName(String code) {
        for (CustomerTrewardTypeEnum productAttributeEnum : CustomerTrewardTypeEnum.values()) {
            if (Objects.equals(productAttributeEnum.getCode(), code)) {
                return productAttributeEnum.getContent();
            }
        }
        return "";
    }
}
